﻿@{
    Layout = "../Shared/_Layout.cshtml";
}
@if (Model.PointList == null)
{ 
    @Html.Raw("暂无积分");
}
else
{
    <div class="box">
        <div class="panel">
            <ul class="nav nav-tabs nav-justified" >
                <li class="active"><a data-toggle="tab" href="#all">全部</a></li>
                <li class=""><a data-toggle="tab" href="#get">获取积分</a></li>
                <li class=""><a data-toggle="tab" href="#using">消费积分</a></li>
            </ul>
            <div class="tab-content" id="myTabContent">
                <div id="all" class="tab-pane fade active in">
                    <table class="table">
                        <thead>
                            <tr>
                                <th>积分详情</th>
                                <th>日期</th>
                                <th>余额</th>
                            </tr>
                        </thead>

                        <tbody>
                            @foreach (var point in Model.PointList)
                            {
                                <tr>
                                    <td>@point.Memo</td>
                                    <td>@point.TradeDate</td>
                                    <td>@point.Points</td>
                                </tr>

                            }

                        </tbody>
                    </table>
              
              
                </div>
                <div id="get" class="tab-pane fade">
              

                    <table class="table">
                        <thead>
                            <tr>
                                <th>积分详情</th>
                                <th>日期</th>
                                <th>积分</th>
                            </tr>
                        </thead>
                           
                        <tbody>、
                            @foreach (var point in Model.PointList)
                            {
                                <tr>
                                    <td>@point.Memo</td>
                                    <td>@point.TradeDate</td>
                                    <td>@point.Increased</td>
                                </tr>
                            }
                        </tbody>
                    </table>
            

                </div>
        
                <div id="using" class="tab-pane fade">
              

                    <table class="table">
                        <thead>
                            <tr>
                                <th>积分详情</th>
                                <th>日期</th>
                                <th>积分</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var point in Model.PointList)
                            {
                                <tr>
                                    <td>@point.Memo</td>
                                    <td>@point.TradeDate</td>
                                    <td>@point.Reduced</td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
        
            </div>
        </div>
        <button id="btnCostMyPoint" type="button" class="btn btn-success btn-block mt20">使用积分去消费</button>
    </div>

    if (Model.TotalCount > 0)
    {
        @Html.Raw("<a href=MyPoint?pageIndex=0>首页</a>   ")  
    }
    if (Model.HasPreviousPage)
    { 
        @Html.Raw("<a href=MyPoint?pageIndex=" + (Model.PageIndex - 1) + ">上一页</a>   ")  
    }
    if (Model.HasNextPage)
    {
        @Html.Raw("<a href=MyPoint?pageIndex=" + (Model.PageIndex + 1) + ">下一页</a>   ")  
    }
    if (Model.TotalCount > 0)
    {
        @Html.Raw("<a href=MyPoint?pageIndex=" + (Model.TotalPage - 1) + ">尾页</a>  ")  
    }
    @Html.Raw("当前第" + (Model.PageIndex + 1) + "页  ")
    @Html.Raw("共计" + Model.TotalCount + "条  ")
    @Html.Raw("每页显示" + Model.PageSize + "条  ")
    @Html.Raw("共" + Model.TotalPage + "页")
}

<script>
    $(function () {
        //得到预览元素
        $costMyPoint = $("#btnCostMyPoint");
       
        $costMyPoint.click(function () {
            window.location.href = "../../";
        });      
    });
</script>

